namespace V2TEK.NET.SH.Silverlight.Calendar
{
    using System;

    public class WorkingPeriod
    {
        private DateTime _endDate;
        private DateTime _startDate;
        private WorkingTime[] _times;
        private bool _working;

        internal WorkingPeriod(DateTime start, DateTime end, bool working, WorkingTime[] times)
        {
            if (times != null)
            {
                this._times = (WorkingTime[]) times.Clone();
                for (int i = 0; i < this._times.Length; i++)
                {
                    this._times[i] = (WorkingTime) this._times[i].Clone();
                }
            }
            this._startDate = start;
            this._endDate = end;
            this._working = working;
        }

        public WorkingTime[] GetWorkingTimes()
        {
            if (this._times == null)
            {
                return new WorkingTime[0];
            }
            WorkingTime[] timeArray = (WorkingTime[]) this._times.Clone();
            for (int i = 0; i < this._times.Length; i++)
            {
                timeArray[i] = (WorkingTime) timeArray[i].Clone();
            }
            return timeArray;
        }

        public DateTime EndDate
        {
            get
            {
                return this._endDate;
            }
        }

        public bool IsWorking
        {
            get
            {
                return this._working;
            }
        }

        public DateTime StartDate
        {
            get
            {
                return this._startDate;
            }
        }
    }
}

